<!--vue模板-->
<template>
  <div>用户列表</div>
</template>

<!--vue 组件选项定义-->
<script setup>
import { ref, onBeforeMount } from "vue";
import { queryUser } from "@/api/sys/user.js";
//声明响应式对象
const tablelist = ref([]);

//查询用户
async function init() {
  let res = await queryUser();
  console.log("res>>", res);
  if (res.code == 200) {
    tablelist.value = res.data.data;
    console.log(" tablelist.value>", tablelist.value);
  }
}

//生命周期构子
onBeforeMount(() => {
  init();
});
</script>

<!--vue样式 scoped当前样式只适用于当前组件-->
<style scoped></style>
